package models

type RespObj struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

// 成功
func Success(code int, data interface{}) RespObj {
	return RespObj{
		Code: code,
		Msg:  "操作成功",
		Data: data,
	}
}

// 失败
func Fail(code int, msg string) RespObj {
	return RespObj{
		Code: code,
		Msg:  msg,
		Data: nil,
	}
}
